﻿@{
    ViewBag.Title = "Home Page";
}
<h2>@ViewBag.Message</h2>
<p>
    To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">
        http://asp.net/mvc</a>.
</p>
<br />
@{
    var album = Request["album"];
}
<script type="text/javascript">
    $(document).ready(function () {
        var upload = $("#plupload_container").pluploadQueue({
            runtimes: 'html5,gears,flash,silverlight,html4',
            url: '@Url.Content("~/Home/Upload")',
            silverlight_xap_url: '../js/plupload.silverlight.xap',
            flash_swf_url: '../js/plupload.flash.swf',
            max_file_size: '500mb',
            chunk_size: '1mb',
            unique_names: false,
            multiple_queues: true,
            multipart_params: { 'album' : '@album' },
            //            resize: { width: 1024, height: 800, quality: 90 },
            filters:
            [
                { title: "Image files", extensions: "jpg,gif,pdf" },
                { title: "Zip files", extensions: "zip" },
                { title: "Document files", extensions: "doc,pdf,txt" }
            ],
            preinit: function (uploader) {
                uploader.bind('FileUploaded', function (up, file) {
                                        $.post("/home/thumbnail",
                                            {
                                                uploadedFilename: file.name,
                                                albumName: 'default'
                                            });

                    up.refresh();
                });
            }
        });
    });
</script>
<div id="plupload_container" style="height: 340px;">
</div>
